<template>
	<view class="money-content">
		<headassy title="仓库库存" :isSearch="false" :isTab="false"></headassy>
		<view class="nav-status text-orange">
			当前状态有{{count}}个物料
		</view>
		<scroll-view>
			<view class="card-list">
				<view class="card mt-5" v-for="item in Loglist" :key="item.id">
					<view class="top">
						<view class="text-info">
							{{item.model ? item.model : ''}}
						</view>
					</view>
					<view class="center">
						<view class="text u-flex-between">
							<view>产品/备件代码:</view>
							<view>{{item.materialsNo ? item.materialsNo : ''}}</view>
						</view>
						<view class="text u-flex-between">
							<view>物料规格:</view>
							<view>{{item.specifica ? item.specifica : ''}}</view>
						</view>
						<view class="text u-flex-between">
							<view>单位:</view>
							<view>{{item.unit ? item.unit : ''}}</view>
						</view>
						<view class="text u-flex-between">
							<view>类型:</view>
							<view>{{item.type ? item.type : ''}}</view>
						</view>
						<view class="text u-flex-between">
							<view>系统库存:</view>
							<view>{{item.systemStock ? item.systemStock : ''}}</view>
						</view>
						<view class="text u-flex-between">
							<view>可用库存:</view>
							<view>{{item.availableStock ? item.availableStock : ''}}</view>
						</view>
					</view>
					<!-- <view class="down u-flex-content-end">
						<view class="right u-flex">
							<view class="cus-btn text-blue mr-5">
								配件费:{{item.spareFee}}
								<span style="color: red;">¥</span>
							</view>
							<view class="cus-btn text-blue mr-5">
								合计:{{item.workFee}}
								<span style="color: red;">¥</span>
							</view>
						</view>
					</view> -->
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabIndex: 0,
				count: '',
				
				params: {
					custAccId: '',
					wareId: "",
					type: "",
					pageNum: 1,
					pageSize: "10",
					typeName: "",
					model: "",
					materialsSku: '',
				},
				custAccId: '',
				newParams: [],
				Loglist: [],
			};
		},
		onLoad() {
			this.params.custAccId = uni.getStorageSync('custAccid')
			this.get_FactoryList()
		},
		// 下拉刷新
		onPullDownRefresh() {
			this.getPullRefresh()
		},
		methods: {
			// 下拉刷新请求数据
			getPullRefresh(){
				console.clear()
				
				this.get_FactoryList()
				
			},
			async get_FactoryList() {
				const res = await uni.$api.factory.getFactoryList2({
					...this.params,
				})
				this.Loglist = res.data.list
				this.count = res.count
				uni.stopPullDownRefresh()
			},
		},

	}
</script>

<style lang="scss">
	/deep/.u-navbar--fixed {
		position: static !important;
	}
	.money-content {
		// height: 100vh;
		background-color: $uni-bg-color-grey;

		.tabs {
			background-color: #fff;
			font-size: 28rpx;
			width: 100%;
		}

		.nav-status {
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			font-size: 28rpx;
		}

		.card-list {
			background: $uni-bg-color-grey;
			padding: 0 28rpx;

			.card {
				padding: 28rpx 32rpx;
				background: #fff;
				border-radius: 10rpx;
				margin-bottom: 28rpx;

				.top {
					border-bottom: solid 1px #f5f5f5;
					padding-bottom: 10px;

					.text-info {
						font-size: 30rpx;
						font-weight: 600;
					}
				}

				.center {
					.title {
						padding-top: 18rpx;
						padding-bottom: 12rpx;

						.title-left {
							font-size: 28rpx;
						}

						.title-right {
							// font-size: 28rpx;
						}
					}

					.text {
						white-space: nowrap;
						text-overflow: ellipsis;
						overflow: hidden;
						font-size: 28rpx;
						color: gray;
						
						view:nth-child(1) {
							width: 220rpx;
							padding: 6rpx 0;
						}
						view:nth-child(2) {
							flex: 1;
							padding-left: 14rpx;
						}
					}
				}

				.down {
					border-top: solid 1px #f5f5f5;
					padding-top: 12px;
				}
			}
		}
	}
</style>